﻿using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.DB;
using YJKRevitStairs.StairsModel.CommonUnit;
using YJKRevitStairs.StairsModel.DataInfos;
using YJKRevitStairs.StairsModel.Manage;

namespace YJKRevitStairs.StairsModel.Kit
{
	public class LinearDoubleRunStairsKit : ProjectionDrawingKit
	{
		public LinearDoubleRunStairsKit(Autodesk.Revit.ApplicationServices.Application app) : base(app)
		{
		}

		private void SetStairsOutSupportPoints(ref LinearDoubleRunStairs stairs, XYZ ptLandTopLft, XYZ ptLandTopRht, XYZ ptTopLandBtmLft, XYZ ptTopLandBtmRht)
		{
			LineRunData leftRunData = stairs.m_LeftRunData;
			LineRunData rightRunData = stairs.m_RightRunData;
			BaseLandingData landData = stairs.m_LandData;
			stairs.m_listPointsSupport.Add(leftRunData.PtRunBottomLeft);
			stairs.m_listPointsSupport.Add(leftRunData.PtRunTopLeft);
			if (landData.TheType != LandingType.LT_None)
			{
				stairs.m_listPointsSupport.Add(ptLandTopLft);
				stairs.m_listPointsSupport.Add(ptLandTopRht);
				stairs.m_listPointsSupport.Add(ptTopLandBtmLft);
				stairs.m_listPointsSupport.Add(ptTopLandBtmRht);
			}
			stairs.m_listPointsSupport.Add(rightRunData.PtRunTopRight);
			stairs.m_listPointsSupport.Add(rightRunData.PtRunBottomRight);
		}

		private void addInsertPoint(ref List<XYZ> listInsertPoints, LinearDoubleRunStairs stairs, XYZ ptLandTopLft, XYZ ptLandTopRht)
		{
			BaseLandingData landData = stairs.m_LandData;
			LineRunData leftRunData = stairs.m_LeftRunData;
			LineRunData rightRunData = stairs.m_RightRunData;
			BaseLandingData topLandData = stairs.m_TopLandData;
			XYZ xyz = XYZ.Zero;
			if (topLandData.TheType != LandingType.LT_None)
			{
				xyz = new XYZ(0.0, -topLandData.Width, 0.0);
			}
			listInsertPoints.Add(leftRunData.PtRunBottomLeft + xyz);
			listInsertPoints.Add(leftRunData.PtRunTopLeft);
			if (landData.TheType == LandingType.LT_Rect)
			{
				listInsertPoints.Add(ptLandTopLft);
				listInsertPoints.Add(ptLandTopRht);
			}
			listInsertPoints.Add(rightRunData.PtRunTopRight);
			listInsertPoints.Add(rightRunData.PtRunBottomRight + xyz);
			listInsertPoints.Add(rightRunData.PtRunBottomLeft);
			listInsertPoints.Add(rightRunData.PtRunTopLeft);
			listInsertPoints.Add(leftRunData.PtRunTopRight);
			listInsertPoints.Add(leftRunData.PtRunBottomRight);
		}

		private void CalcRunPosition(ref LinearDoubleRunStairs stairs)
		{
			LineRunData leftRunData = stairs.m_LeftRunData;
			LineRunData rightRunData = stairs.m_RightRunData;
			BaseLandingData landData = stairs.m_LandData;
			double stairsWellWidth = stairs.GetStairsWellWidth();
			double width = landData.Width;
			double dStairsWidth = stairs.m_dStairsWidth;
			double dStairsLength = stairs.m_dStairsLength;
			XYZ xyz = new XYZ((dStairsWidth - stairsWellWidth) / 2.0, 0.0, 0.0);
			XYZ xyz2 = new XYZ(0.0, leftRunData.RunLength, 0.0);
			XYZ xyz3 = new XYZ(0.0, rightRunData.RunLength, 0.0);
			XYZ xyz4 = new XYZ(stairsWellWidth, 0.0, 0.0);
			XYZ zero = XYZ.Zero;
			XYZ xyz5 = zero + xyz;
			XYZ ptRunTopLeft = zero + xyz2;
			XYZ ptRunTopRight = xyz5 + xyz2;
			XYZ xyz6 = xyz5 + xyz4;
			XYZ xyz7 = xyz6 + xyz;
			XYZ ptRunTopLeft2 = xyz6 + xyz3;
			XYZ ptRunTopRight2 = xyz7 + xyz3;
			stairs.m_LeftRunData.PtRunBottomLeft = zero;
			stairs.m_LeftRunData.PtRunBottomRight = xyz5;
			stairs.m_LeftRunData.PtRunTopLeft = ptRunTopLeft;
			stairs.m_LeftRunData.PtRunTopRight = ptRunTopRight;
			stairs.m_RightRunData.PtRunBottomLeft = xyz6;
			stairs.m_RightRunData.PtRunBottomRight = xyz7;
			stairs.m_RightRunData.PtRunTopLeft = ptRunTopLeft2;
			stairs.m_RightRunData.PtRunTopRight = ptRunTopRight2;
		}

		private void CalcRectLandTopPos(LinearDoubleRunStairs stairs, ref XYZ ptLandTopLft, ref XYZ ptLandTopRht)
		{
			BaseLandingData landData = stairs.m_LandData;
			BaseRunData leftRunData = stairs.m_LeftRunData;
			LineRunData rightRunData = stairs.m_RightRunData;
			double dStairsWidth = stairs.m_dStairsWidth;
			double width = landData.Width;
			XYZ xyz = new XYZ(dStairsWidth, 0.0, 0.0);
			XYZ xyz2 = new XYZ(0.0, width, 0.0);
			XYZ xyz3;
			XYZ xyz4;
			if (leftRunData.TreadCount >= rightRunData.TreadCount)
			{
				xyz3 = stairs.m_LeftRunData.PtRunTopLeft;
				xyz4 = xyz3 + xyz;
			}
			else
			{
				xyz4 = stairs.m_RightRunData.PtRunTopRight;
				xyz3 = xyz4 - xyz;
			}
			ptLandTopLft = xyz3 + xyz2;
			ptLandTopRht = xyz4 + xyz2;
		}

		private void CalcRectTopLandTopPos(LinearDoubleRunStairs staris, ref XYZ ptTopLandBtmLft, ref XYZ ptTopLandBtmRht)
		{
			BaseLandingData topLandData = staris.m_TopLandData;
			LineRunData leftRunData = staris.m_LeftRunData;
			LineRunData rightRunData = staris.m_RightRunData;
			double width = topLandData.Width;
			XYZ xyz = new XYZ(0.0, -width, 0.0);
			XYZ ptRunBottomLeft = leftRunData.PtRunBottomLeft;
			XYZ ptRunBottomRight = rightRunData.PtRunBottomRight;
			ptTopLandBtmLft = ptRunBottomLeft + xyz;
			ptTopLandBtmRht = ptRunBottomRight + xyz;
		}

		private void DrawDoubleRunStairsRunCurves(ref LinearDoubleRunStairs param_stairs, bool bLeftSideUp, bool bDrawNoteInfo)
		{
			LineRunData leftRunData = param_stairs.m_LeftRunData;
			LineRunData rightRunData = param_stairs.m_RightRunData;
			if (bLeftSideUp)
			{
				SingleRunCurveInfo singleRunCurveInfo = new SingleRunCurveInfo();
				singleRunCurveInfo.BottomElevation = leftRunData.BottomElevation;
				base.DrawLinearRun(leftRunData, leftRunData.PtRunBottomLeft, leftRunData.PtRunBottomRight, leftRunData.PtRunTopRight, leftRunData.PtRunTopLeft, ref singleRunCurveInfo, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
				param_stairs.m_listRunCurve.Add(singleRunCurveInfo);
				singleRunCurveInfo = new SingleRunCurveInfo();
				singleRunCurveInfo.BottomElevation = rightRunData.BottomElevation;
				base.DrawLinearRun(rightRunData, rightRunData.PtRunTopRight, rightRunData.PtRunTopLeft, rightRunData.PtRunBottomLeft, rightRunData.PtRunBottomRight, ref singleRunCurveInfo, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
				param_stairs.m_listRunCurve.Add(singleRunCurveInfo);
				return;
			}
			SingleRunCurveInfo singleRunCurveInfo2 = new SingleRunCurveInfo();
			singleRunCurveInfo2.BottomElevation = rightRunData.BottomElevation;
			base.DrawLinearRun(rightRunData, rightRunData.PtRunBottomLeft, rightRunData.PtRunBottomRight, rightRunData.PtRunTopRight, rightRunData.PtRunTopLeft, ref singleRunCurveInfo2, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
			param_stairs.m_listRunCurve.Add(singleRunCurveInfo2);
			singleRunCurveInfo2 = new SingleRunCurveInfo();
			singleRunCurveInfo2.BottomElevation = leftRunData.BottomElevation;
			base.DrawLinearRun(leftRunData, leftRunData.PtRunTopRight, leftRunData.PtRunTopLeft, leftRunData.PtRunBottomLeft, leftRunData.PtRunBottomRight, ref singleRunCurveInfo2, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
			param_stairs.m_listRunCurve.Add(singleRunCurveInfo2);
		}

		private void DrawDoubleRunStairsLandingCurves(ref LinearDoubleRunStairs param_stairs, XYZ ptLandTopLft, XYZ ptLandTopRht)
		{
			BaseLandingData landData = param_stairs.m_LandData;
			LineRunData leftRunData = param_stairs.m_LeftRunData;
			LineRunData rightRunData = param_stairs.m_RightRunData;
			XYZ xyz = new XYZ(param_stairs.GetStairsWellWidth(), 0.0, 0.0);
			if (landData.TheType == LandingType.LT_Rect)
			{
				List<XYZ> list = new List<XYZ>();
				if (leftRunData.TreadCount == rightRunData.TreadCount)
				{
					list.Add(leftRunData.PtRunTopLeft);
					list.Add(ptLandTopLft);
					list.Add(ptLandTopRht);
					list.Add(rightRunData.PtRunTopRight);
				}
				else if (leftRunData.TreadCount > rightRunData.TreadCount)
				{
					XYZ item = leftRunData.PtRunTopRight + xyz;
					list.Add(rightRunData.PtRunTopRight);
					list.Add(rightRunData.PtRunTopLeft);
					list.Add(item);
					list.Add(leftRunData.PtRunTopRight);
					list.Add(leftRunData.PtRunTopLeft);
					list.Add(ptLandTopLft);
					list.Add(ptLandTopRht);
				}
				else
				{
					XYZ item2 = rightRunData.PtRunTopLeft - xyz;
					list.Add(rightRunData.PtRunTopRight);
					list.Add(rightRunData.PtRunTopLeft);
					list.Add(item2);
					list.Add(leftRunData.PtRunTopRight);
					list.Add(leftRunData.PtRunTopLeft);
					list.Add(ptLandTopLft);
					list.Add(ptLandTopRht);
				}
				List<CurveInfo> landCurves = base.CreateLandEdgeloop(list);
				double bottomElevation = 0.0;
				LandingCurveInfo item3 = new LandingCurveInfo(landCurves, bottomElevation);
				param_stairs.m_listLandCurve.Add(item3);
				return;
			}
			if (landData.TheType == LandingType.LT_Sector)
			{
				XYZ xyz2 = new XYZ(param_stairs.m_dStairsWidth, 0.0, 0.0);
				List<CurveInfo> list2 = new List<CurveInfo>();
				if (leftRunData.TreadCount == rightRunData.TreadCount)
				{
					XYZ xyz3 = leftRunData.PtRunTopLeft;
					XYZ xyz4 = rightRunData.PtRunTopRight;
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptLandTopRht, xyz4, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz4, xyz3, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz3, ptLandTopLft, null));
				}
				else if (leftRunData.TreadCount > rightRunData.TreadCount)
				{
					XYZ xyz3 = leftRunData.PtRunTopLeft;
					XYZ xyz4 = xyz3 + xyz2;
					XYZ xyz5 = leftRunData.PtRunTopRight + xyz;
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptLandTopRht, xyz4, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz4, rightRunData.PtRunTopRight, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, rightRunData.PtRunTopRight, rightRunData.PtRunTopLeft, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, rightRunData.PtRunTopLeft, xyz5, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz5, xyz3, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz3, ptLandTopLft, null));
				}
				else
				{
					XYZ xyz3 = rightRunData.PtRunTopRight - xyz2;
					XYZ xyz4 = rightRunData.PtRunTopRight;
					XYZ xyz6 = rightRunData.PtRunTopLeft - xyz;
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptLandTopRht, xyz4, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz4, xyz6, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz6, leftRunData.PtRunTopRight, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, leftRunData.PtRunTopRight, leftRunData.PtRunTopLeft, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, leftRunData.PtRunTopLeft, xyz3, null));
					list2.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz3, ptLandTopLft, null));
				}
				if (landData.Width > 0.0)
				{
					XYZ xyz7 = Geometry.CalculatMidPoint(ptLandTopLft, ptLandTopRht);
					XYZ xyz8 = new XYZ(0.0, param_stairs.m_dStairsWidth / 2.0, 0.0);
					XYZ ptM = xyz7 + xyz8;
					list2.Add(base.NewArc(PenColor.PC_Gray, DashStyle.Solid, 2f, ptLandTopLft, ptLandTopRht, ptM));
				}
				double bottomElevation2 = 0.0;
				LandingCurveInfo item4 = new LandingCurveInfo(list2, bottomElevation2);
				param_stairs.m_listLandCurve.Add(item4);
			}
		}

		private void DrawDoubleRunStairsTopLandingCurves(ref LinearDoubleRunStairs param_stairs, XYZ ptTopLandBtmLft, XYZ ptTopLandBtmRht)
		{
			BaseLandingData topLandData = param_stairs.m_TopLandData;
			double dStairsWidth = param_stairs.m_dStairsWidth;
			LineRunData leftRunData = param_stairs.m_LeftRunData;
			LineRunData rightRunData = param_stairs.m_RightRunData;
			new XYZ(0.0, -topLandData.Width, 0.0);
			new XYZ(dStairsWidth, 0.0, 0.0);
			XYZ xyz = new XYZ(0.0, -ConstValueManager.StairsTopLandOffset, 0.0);
			if (topLandData.TheType == LandingType.LT_Rect)
			{
				List<CurveInfo> landCurves = base.CreateLandEdgeloop(new List<XYZ>
				{
					leftRunData.PtRunBottomLeft + xyz,
					rightRunData.PtRunBottomRight + xyz,
					ptTopLandBtmRht,
					ptTopLandBtmLft
				});
				double bottomElevation = 0.0;
				LandingCurveInfo item = new LandingCurveInfo(landCurves, bottomElevation);
				param_stairs.m_listTopLandCurve.Add(item);
				return;
			}
			if (topLandData.TheType == LandingType.LT_Sector)
			{
				XYZ xyz2 = leftRunData.PtRunBottomLeft + xyz;
				XYZ xyz3 = rightRunData.PtRunBottomRight + xyz;
				List<CurveInfo> list = new List<CurveInfo>();
				list.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptTopLandBtmLft, xyz2, null));
				list.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz2, xyz3, null));
				list.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz3, ptTopLandBtmRht, null));
				if (topLandData.Width > 0.0)
				{
					XYZ xyz4 = Geometry.CalculatMidPoint(ptTopLandBtmLft, ptTopLandBtmRht);
					XYZ xyz5 = new XYZ(0.0, -param_stairs.m_dStairsWidth / 2.0, 0.0);
					XYZ ptM = xyz4 + xyz5;
					list.Add(base.NewArc(PenColor.PC_Gray, DashStyle.Solid, 2f, ptTopLandBtmRht, ptTopLandBtmLft, ptM));
				}
				double bottomElevation2 = 0.0;
				LandingCurveInfo item2 = new LandingCurveInfo(list, bottomElevation2);
				param_stairs.m_listTopLandCurve.Add(item2);
			}
		}

		private void DrawDoubleRunStairsBeamCurves(ref LinearDoubleRunStairs param_stairs, bool bLeftSideUp, bool bBottom, bool bMid, bool bTop)
		{
			LineRunData leftRunData = param_stairs.m_LeftRunData;
			LineRunData rightRunData = param_stairs.m_RightRunData;
			BaseBeamData beamData = param_stairs.m_BeamData;
			BaseLandingData landData = param_stairs.m_LandData;
			double num = beamData.BeamWidth / 2.0;
			double width = landData.Width;
			XYZ xyz = new XYZ(0.0, num, 0.0);
			XYZ xyz2 = new XYZ(param_stairs.m_dStairsWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(0.0, width, 0.0);
			XYZ xyz4 = XYZ.Zero;
			XYZ xyz5 = XYZ.Zero;
			if (bBottom)
			{
				List<CurveInfo> list = new List<CurveInfo>();
				if (bLeftSideUp)
				{
					xyz4 = leftRunData.PtRunBottomLeft - xyz;
					xyz5 = leftRunData.PtRunBottomRight - xyz;
					list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, xyz4, xyz5, xyz));
				}
				else
				{
					xyz4 = rightRunData.PtRunBottomLeft - xyz;
					xyz5 = rightRunData.PtRunBottomRight - xyz;
					list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, xyz4, xyz5, xyz));
				}
				double bottomElevation = 0.0;
				BeamCurveInfo beamCurveInfo = new BeamCurveInfo(list, bottomElevation);
				beamCurveInfo.m_Type = BeamType.BT_Bottom;
				beamCurveInfo.m_nFloorNum = 0;
				param_stairs.m_listBeamCurve.Add(beamCurveInfo);
			}
			if (bMid)
			{
				List<CurveInfo> list = new List<CurveInfo>();
				if (leftRunData.TreadCount == rightRunData.TreadCount)
				{
					xyz4 = leftRunData.PtRunTopLeft;
					xyz5 = rightRunData.PtRunTopRight;
				}
				else if (leftRunData.TreadCount > rightRunData.TreadCount)
				{
					xyz4 = leftRunData.PtRunTopLeft;
					xyz5 = xyz4 + xyz2;
				}
				else
				{
					xyz5 = rightRunData.PtRunTopRight;
					xyz4 = xyz5 - xyz2;
				}
				XYZ xyz6 = (xyz4 - xyz5).Normalize().Multiply(num);
				xyz4 -= xyz6;
				xyz5 += xyz6;
				XYZ ptS = xyz4 + xyz;
				XYZ ptE = xyz5 + xyz;
				list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS, ptE, null));
				XYZ ptS2 = xyz4;
				XYZ ptE2 = xyz4 + xyz3;
				XYZ ptS3 = xyz5;
				XYZ ptE3 = xyz5 + xyz3;
				list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS2, ptE2, null));
				list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS3, ptE3, null));
				XYZ ptS4 = xyz4 + xyz3 - xyz;
				XYZ ptE4 = xyz5 + xyz3 - xyz;
				list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS4, ptE4, null));
				double bottomElevation2 = 0.0;
				BeamCurveInfo beamCurveInfo2 = new BeamCurveInfo(list, bottomElevation2);
				beamCurveInfo2.m_Type = BeamType.BT_Mid;
				beamCurveInfo2.m_nFloorNum = 0;
				param_stairs.m_listBeamCurve.Add(beamCurveInfo2);
			}
			if (bTop)
			{
				List<CurveInfo> list = new List<CurveInfo>();
				if (bLeftSideUp)
				{
					xyz4 = rightRunData.PtRunBottomLeft - xyz;
					xyz5 = rightRunData.PtRunBottomRight - xyz;
					list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, xyz4, xyz5, -xyz));
				}
				else
				{
					xyz4 = leftRunData.PtRunBottomLeft - xyz;
					xyz5 = leftRunData.PtRunBottomRight - xyz;
					list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, xyz4, xyz5, -xyz));
				}
				double bottomElevation3 = 0.0;
				BeamCurveInfo beamCurveInfo3 = new BeamCurveInfo(list, bottomElevation3);
				beamCurveInfo3.m_Type = BeamType.BT_Top;
				beamCurveInfo3.m_nFloorNum = 0;
				param_stairs.m_listBeamCurve.Add(beamCurveInfo3);
			}
		}

		private void DrawUpStairsNoteInfo(ref LinearDoubleRunStairs param_stairs, bool bLeftSideUp)
		{
			LineRunData leftRunData = param_stairs.m_LeftRunData;
			LineRunData rightRunData = param_stairs.m_RightRunData;
			XYZ xyz = XYZ.BasisY * 1.3;
			List<UpDownText> list = new List<UpDownText>();
			string sText = "上";
			string sText2 = "下";
			if (bLeftSideUp)
			{
				XYZ pos = Geometry.CalculatMidPoint(leftRunData.PtRunBottomLeft, leftRunData.PtRunBottomRight) - xyz;
				XYZ pos2 = Geometry.CalculatMidPoint(rightRunData.PtRunBottomLeft, rightRunData.PtRunBottomRight) - xyz;
				UpDownText item = new UpDownText(pos, sText);
				list.Add(item);
				item = new UpDownText(pos2, sText2);
				list.Add(item);
				base.DrawUpDownNoteInfo(ref param_stairs.m_listText, list);
				return;
			}
			XYZ pos3 = Geometry.CalculatMidPoint(rightRunData.PtRunBottomLeft, rightRunData.PtRunBottomRight) - xyz;
			XYZ pos4 = Geometry.CalculatMidPoint(leftRunData.PtRunBottomLeft, leftRunData.PtRunBottomRight) - xyz;
			UpDownText item2 = new UpDownText(pos3, sText);
			list.Add(item2);
			item2 = new UpDownText(pos4, sText2);
			list.Add(item2);
			base.DrawUpDownNoteInfo(ref param_stairs.m_listText, list);
		}

		private void DrawDoubleRunStairsNoteInfo(ref LinearDoubleRunStairs param_stairs)
		{
			LineRunData leftRunData = param_stairs.m_LeftRunData;
			LineRunData rightRunData = param_stairs.m_RightRunData;
			BaseLandingData landData = param_stairs.m_LandData;
			BaseLandingData topLandData = param_stairs.m_TopLandData;
			XYZ xyz = new XYZ(0.0, landData.Width, 0.0);
			XYZ xyz2 = new XYZ(0.0, topLandData.Width, 0.0);
			double dStairsWidth = param_stairs.m_dStairsWidth;
			new XYZ(dStairsWidth, 0.0, 0.0);
			XYZ xyz3 = XYZ.BasisY * 2.0;
			XYZ xyz4 = XYZ.BasisX * 2.0;
			XYZ zero = XYZ.Zero;
			XYZ zero2 = XYZ.Zero;
			this.CalcRectLandTopPos(param_stairs, ref zero, ref zero2);
			XYZ zero3 = XYZ.Zero;
			XYZ zero4 = XYZ.Zero;
			this.CalcRectTopLandTopPos(param_stairs, ref zero3, ref zero4);
			XYZ xyz5 = XYZ.Zero;
			XYZ xyz6 = XYZ.Zero;
			XYZ xyz7 = new XYZ(0.0, dStairsWidth / 2.0, 0.0);
			xyz5 = zero + xyz3;
			xyz6 = zero2 + xyz3;
			if (landData.TheType == LandingType.LT_Sector && landData.Width > 0.0)
			{
				xyz5 += xyz7;
				xyz6 += xyz7;
			}
			base.DrawStairsNoteInfo(ref param_stairs.m_listOtherCurve, ref param_stairs.m_listText, xyz5, xyz6, "梯间宽度", 0.8, 5.0, 2.0, XYZ.BasisY, PenColor.PC_Black);
			xyz5 = zero - xyz4;
			xyz6 = leftRunData.PtRunBottomLeft - xyz4;
			if (topLandData.TheType != LandingType.LT_None)
			{
				xyz6 = zero3 - xyz4;
			}
			base.DrawStairsNoteInfo(ref param_stairs.m_listOtherCurve, ref param_stairs.m_listText, xyz5, xyz6, "梯间长度", 0.8, 2.0, 5.0, -XYZ.BasisX, PenColor.PC_Black);
			if (landData.TheType != LandingType.LT_None && landData.Width > 0.0)
			{
				xyz5 = zero2 + xyz4;
				xyz6 = xyz5 - xyz;
				base.DrawStairsNoteInfo(ref param_stairs.m_listOtherCurve, ref param_stairs.m_listText, xyz5, xyz6, "平台宽度", 0.8, 2.0, 5.0, XYZ.BasisX, PenColor.PC_Black);
			}
			if (topLandData.TheType != LandingType.LT_None && topLandData.Width > 0.0)
			{
				xyz5 = zero4 + xyz4;
				xyz6 = xyz5 + xyz2;
				base.DrawStairsNoteInfo(ref param_stairs.m_listOtherCurve, ref param_stairs.m_listText, xyz5, xyz6, "平台宽度", 0.8, 2.0, 5.0, XYZ.BasisX, PenColor.PC_Black);
			}
		}

		public bool LinearDoubleRunStairsProfileCurves(ref LinearDoubleRunStairs stairs, bool bDrawNoteInfo, int basePointIndex, bool lrMirror, bool tbMirror, bool bLeftSideUp, double rotateAngle, bool bBottom, bool bMid, bool bTop)
		{
			bool result = true;
			double dStairsWidth = stairs.m_dStairsWidth;
			double dStairsLength = stairs.m_dStairsLength;
			this.CalcRunPosition(ref stairs);
			XYZ ptLandTopLft = null;
			XYZ ptLandTopRht = null;
			this.CalcRectLandTopPos(stairs, ref ptLandTopLft, ref ptLandTopRht);
			XYZ ptTopLandBtmLft = null;
			XYZ ptTopLandBtmRht = null;
			this.CalcRectTopLandTopPos(stairs, ref ptTopLandBtmLft, ref ptTopLandBtmRht);
			List<XYZ> list = new List<XYZ>();
			this.addInsertPoint(ref list, stairs, ptLandTopLft, ptLandTopRht);
			this.SetStairsOutSupportPoints(ref stairs, ptLandTopLft, ptLandTopRht, ptTopLandBtmLft, ptTopLandBtmRht);
			XYZ xyz = list[basePointIndex];
			base.CalulateTransform(lrMirror, tbMirror, rotateAngle, dStairsWidth, dStairsLength, xyz);
			stairs.m_TransVector = Geometry.TransformPoint(xyz, this.m_Transform);
			stairs.m_listOtherCurve.AddRange(base.DrawBasePoint(xyz, 100.0));
			stairs.m_Transform = this.m_Transform;
			this.DrawDoubleRunStairsRunCurves(ref stairs, bLeftSideUp, bDrawNoteInfo);
			this.DrawDoubleRunStairsLandingCurves(ref stairs, ptLandTopLft, ptLandTopRht);
			this.DrawDoubleRunStairsTopLandingCurves(ref stairs, ptTopLandBtmLft, ptTopLandBtmRht);
			this.DrawDoubleRunStairsBeamCurves(ref stairs, bLeftSideUp, bBottom, bMid, bTop);
			if (bDrawNoteInfo)
			{
				this.DrawUpStairsNoteInfo(ref stairs, bLeftSideUp);
			}
			this.DrawDoubleRunStairsNoteInfo(ref stairs);
			return result;
		}
	}
}
